package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.UserDto;
import com.zzyl.entity.User;
import com.zzyl.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UsersMapper {
    // 分页查询
    Page<List<UserVo>> getPage(UserDto userDto);

    // 新增用户
    void insert(User user);


    //用户修改
    void updateUser(User user);

    //删除
    void deleteUser(Long userId);

    // 启用禁用
    @Update("update sys_user set data_state = #{dataState} where id = #{id}")
    void updateEnable(User user);
    //启用禁用查询
    @Select("select * from sys_user where id = #{id}")
    User select(Long id);


}
